/* Copyright (C) 2006 Space Headed Productions
* 
* WeaponMod is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with WeaponMod; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

#if defined _weaponmod_included
  #endinput
#endif
#define _weaponmod_included

#pragma library WeaponMod

// Strings
enum wpn_string
{
	wpn_name,
	wpn_short,
	wpn_file,
	
	wpn_viewmodel,
	wpn_weaponmodel,
	wpn_worldmodel
}

// Integers
enum wpn_integer
{
	wpn_cost,
	wpn_firerate,
	wpn_ammo1,
	wpn_ammo2,
	wpn_keep_press,
	wpn_bullets_per_shot1,
	wpn_bullets_per_shot2,
	
	wpn_pluginid,
}

// Floats
enum wpn_float
{
	Float:wpn_refire_rate1,
	Float:wpn_refire_rate2,
	Float:wpn_reload_time,
	Float:wpn_run_speed,
	Float:wpn_recoil1,
	Float:wpn_recoil2
}

// Events
enum wpn_event
{
	event_attack1,		// user, bullets
	event_attack2,		// user, bullets
	event_reload,		// user
	event_pickup,		// user
	event_draw,		// user
	event_hide,		// user
	event_worldspawn,	// entity
	event_weapondrop	// dropper, entity
}

// User information
enum usr_info
{
	usr_wpn_index,
	usr_wpn_ammo1,
	usr_wpn_ammo2
}

// Entity Weapon Information
enum ent_info
{
	ent_wpn_index,
	ent_wpn_ammo1,
	ent_wpn_ammo2
}

// Offsets
enum offset
{
	offset_csmoney,
	offset_csdeaths
}


/*
* General weapon functions
*
*/

// Register a new weapon
// "short_name" will be used for things like DeathMsg
//   returns Weapon ID
native wpn_register_weapon(weaponname[],short_name[]);

// Registers an event
native wpn_register_event(weaponid, wpn_event:index, function[]);

// Gets an event
native wpn_get_event(weaponid, wpn_event:index, function[], len);

// Sets a string by given weapon (weaponid)
native wpn_set_string(weaponid, wpn_string:index, string[]);

// Gets a string by given weapon (weaponid)
native wpn_get_string(weaponid, wpn_string:index, string[], len);

// Sets a integer by given weapon (weaponid)
native wpn_set_integer(weaponid, wpn_integer:index, integer);

// Returns integer by given weapon (weaponid)
native wpn_get_integer(weaponid, wpn_integer:index);

// Sets a float by given weapon (weaponid)
native wpn_set_float(weaponid, wpn_float:index, Float:fl);

// Returns float by given weapon (weaponid)
native Float:wpn_get_float(weaponid, wpn_float:index);

/*
* Some misc functions :)
*
*/

// Damages an user
//  Returns damage made (-1 when killed/-2 when aborted external)
native wpn_damage_user(weaponid, victim, attacker, dmg_save, dmg_take, dmg_type, hitplace=0);

// Makes radius damage
//  Returns amount of players hit
native wpn_radius_damage(weaponid, attacker, Float:sourceOrigin[3], Float:range, Float:damage, damageType);

// Kills a player
native wpn_kill_user(weaponid, victim, attacker, headshot=0);

// Shoots a normal bullet
//  Returns hit player
native wpn_bullet_shot(weaponid, attacker, dmg_save, dmg_take);

// Plays an animation
native wpn_playanim(player, animation);

// Returns amount of registered weapons
native wpn_weapon_count();

// Gives user a weapon
native wpn_give_weapon(weaponid, player, ammo1, ammo2);

// Sets an offset int
native wpn_set_offset_int(player, offset:index, value);

// Gets an offset int
native wpn_get_offset_int(player, offset:index);

// Spawns a weapon entity
native wpn_spawn_weapon(weaponid, Float:Origin[3], ammo1, ammo2);

// Sets the view of an entity to the given origin
native wpn_set_entity_view(entity, Float:Origin[3]);

// Kills a user TOTALLY silent (no DeathMsg on no log entry)
native wpn_user_silentkill(player);

// Use this to get the correct projectile start position
native wpn_projectile_startpos(player, vForward, vRight, vUp, Float:StartPos[3]);

// Called before an event happens
//  Returning in PLUGIN_HANDLED will block event
forward wpn_event_pre(player, wpnid, wpn_event:event, params[]);

// Called after an event happenened
forward wpn_event_post(player, wpnid, wpn_event:event, params[]);

// Called BEFORE damage gets caused by weaponmod natives
//  Returning in PLUGIN_HANDLED will block damage call
forward wpn_attack_damage(victim, attacker, wpnid, damage, hitplace);

/*
* User infos
*
*/

// Has user this weapon
//  returns user weapon index or -1
native wpn_has_weapon(player, weaponid);

// Sets user information
native wpn_set_userinfo(player, usr_info:index, user_weapon, value);

// Returns user information
native wpn_get_userinfo(player, usr_info:index, user_weapon);

// Reload weapon
native wpn_reload_weapon(player);

/*
* Entity infos
*
*/

// Is this a registered weapon entity
//  returns entindex or -1
native wpn_is_wpnentity(entity);

// sets entity information
native wpn_set_entinfo(entindex, ent_info:index, value);

// Returns entity information
native wpn_get_entinfo(entindex, ent_info:index);
